//造div
var nprogress = document.createElement('div')
 nprogress.style.width = '0%'
nprogress.style.position = 'fixed'
nprogress.style.top = 0
nprogress.style.height = '5px'
nprogress.style.backgroundColor ='#29d'
document.body.appendChild(nprogress)

//搞一个定时器
var sum = 0
t = setInterval(function () {
    sum++
    nprogress.style.width = sum +'%'
    if(sum >=100){
        nprogress.style.width = 100 +'%'
        // document.body.removeChild(nprogress)
        nprogress.style.display = 'none'
    }
},1)
